﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace Simple.ViewModel
{
    public class TreeMenuListModel
    {
        public long id { get; set; }
        public long ParentId { get; set; }
        public string text { get; set; }
        public string iconCls { get; set; }
        /// <summary>
        /// node state, 'open' or 'closed', default is 'open'. When set to 'closed', the node have children nodes and will load them from remote site
        /// </summary>
        public string state { get; set; }
        [JsonProperty("checked")]
        public bool Checked { get; set; }
        public IList<TreeMenuListModel> children { get; set; }
    }

    public class MenuTreeListModel
    {
        public string id { get; set; }
        [JsonIgnore]
        public string parent { get; set; }
        public string text { get; set; }
        public string icon { get; set; }
        public int? sort { get; set; }
        public StateClass state { get; set; }
        public IList<MenuTreeListModel> children { get; set; }
        public string tag { get; set; }

    }

    public class StateClass
    {
        public bool opened { get; set; }
        public bool disabled { get; set; }
        public bool selected { get; set; }
    }
}
